Setting a default branch

Last updated on
29 January 2026

Before you try to change the default branch, make sure you have the right permissions.

You must:

  • Have both Administer maintainers and Write to VCS permissions for the project
  • Be assigned the Maintainer role in GitLab

Without these, the Settings menu will not appear.

To set a default branch for your project:

  1. Go to your project page and click Source code to open GitLab.
  2. In the left sidebar, open Settings, then click Repository.
  3. Expand Branch defaults and choose the default branch.

Screenshot pointing to the Settings > Repository and Branch defaults

If you have the required permissions but still don’t see Settings, confirm that you are signed in to GitLab using the link in the top right corner.

The selected branch will be shown by default in the version control instructions and will be checked out when someone clones the project without specifying a branch.

Help improve this page

Page status: No known problems

You can: